package com.yiyahui.project.erp.service.impl;

import java.util.List;
import com.yiyahui.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiyahui.project.erp.mapper.YiyaChargeModeMapper;
import com.yiyahui.project.erp.domain.YiyaChargeMode;
import com.yiyahui.project.erp.service.IYiyaChargeModeService;

/**
 * 收费方式Service业务层处理
 * 
 * @author yiyahui
 * @date 2020-05-29
 */
@Service
public class YiyaChargeModeServiceImpl implements IYiyaChargeModeService 
{
    @Autowired
    private YiyaChargeModeMapper yiyaChargeModeMapper;

    /**
     * 查询收费方式
     * 
     * @param id 收费方式ID
     * @return 收费方式
     */
    @Override
    public YiyaChargeMode selectYiyaChargeModeById(Long id)
    {
        return yiyaChargeModeMapper.selectYiyaChargeModeById(id);
    }

    /**
     * 查询收费方式列表
     * 
     * @param yiyaChargeMode 收费方式
     * @return 收费方式
     */
    @Override
    public List<YiyaChargeMode> selectYiyaChargeModeList(YiyaChargeMode yiyaChargeMode)
    {
        return yiyaChargeModeMapper.selectYiyaChargeModeList(yiyaChargeMode);
    }

    /**
     * 新增收费方式
     * 
     * @param yiyaChargeMode 收费方式
     * @return 结果
     */
    @Override
    public int insertYiyaChargeMode(YiyaChargeMode yiyaChargeMode)
    {
        yiyaChargeMode.setCreateTime(DateUtils.getNowDate());
        return yiyaChargeModeMapper.insertYiyaChargeMode(yiyaChargeMode);
    }

    /**
     * 修改收费方式
     * 
     * @param yiyaChargeMode 收费方式
     * @return 结果
     */
    @Override
    public int updateYiyaChargeMode(YiyaChargeMode yiyaChargeMode)
    {
        yiyaChargeMode.setUpdateTime(DateUtils.getNowDate());
        return yiyaChargeModeMapper.updateYiyaChargeMode(yiyaChargeMode);
    }

    /**
     * 批量删除收费方式
     * 
     * @param ids 需要删除的收费方式ID
     * @return 结果
     */
    @Override
    public int deleteYiyaChargeModeByIds(Long[] ids)
    {
        return yiyaChargeModeMapper.deleteYiyaChargeModeByIds(ids);
    }

    /**
     * 删除收费方式信息
     * 
     * @param id 收费方式ID
     * @return 结果
     */
    @Override
    public int deleteYiyaChargeModeById(Long id)
    {
        return yiyaChargeModeMapper.deleteYiyaChargeModeById(id);
    }
}
